home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F34998_map.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  1.9 KB  |  59 lines

  1. <xsl:stylesheet version="1.0" 
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:saxon="http://icl.com/saxon"
  4. xmlns:map-foldl-func="map-foldl-func"
  5. exclude-result-prefixes="xsl saxon map-foldl-func"
  6. >
  7.    <xsl:import href="foldl.xsl"/>
  8.  
  9.    <map-foldl-func:map-foldl-func/>
  10.    
  11.      <xsl:template name="map">
  12.       <xsl:param name="pFun" select="/.."/>
  13.       <xsl:param name="pList1" select="/.."/>
  14.  
  15.        <xsl:variable name="vFoldlFun" select="document('')/*/map-foldl-func:*[1]"/>
  16.        
  17.        <xsl:variable name="vFuncComposition">
  18.          <xsl:copy-of select="$vFoldlFun"/>
  19.          <xsl:copy-of select="$pFun"/>
  20.        </xsl:variable>
  21.        
  22.        <xsl:variable name="vFComposition" 
  23.                      select="saxon:node-set($vFuncComposition)/*"/>
  24.  
  25.       <xsl:call-template name="foldl">
  26.         <xsl:with-param name="pFunc" select="$vFComposition"/>
  27.         <xsl:with-param name="pList" select="$pList1"/>
  28.         <xsl:with-param name="pA0" select="/.."/>
  29.       </xsl:call-template>
  30.     </xsl:template>
  31.  
  32.  
  33.     <xsl:template name="mapL" match="*[namespace-uri() = 'map-foldl-func']">
  34.          <xsl:param name="arg0" select="/.."/>
  35.          <xsl:param name="arg1" select="/.."/>
  36.          <xsl:param name="arg2" select="/.."/>
  37.          
  38.          <!-- $arg1 must be A0 -->
  39.          <xsl:copy-of select="$arg1"/>
  40.          
  41.          <xsl:variable name="vFun1Result">
  42.            <xsl:apply-templates select="$arg0[1]">
  43.              <xsl:with-param name="arg1" select="$arg2[1]"/>
  44.            </xsl:apply-templates>
  45.          </xsl:variable>
  46.          <xsl:apply-templates select="$arg2" mode="copy">
  47.            <xsl:with-param name="pContents" select="saxon:node-set($vFun1Result)"/>
  48.          </xsl:apply-templates>
  49.     </xsl:template>
  50.     
  51.     <xsl:template match="*" mode="copy">
  52.       <xsl:param name="pContents"/>
  53.       
  54.       <xsl:copy>
  55.         <xsl:copy-of select="$pContents"/>
  56.       </xsl:copy>
  57.     </xsl:template>
  58.  
  59. </xsl:stylesheet>